//
// @author 风杨
// @date 22-9-2 上午8:29
// @see <a href="yueny09@163.com">mailTo: yueny09@163.com</a>
//

//! # DurationX
//!
//! `DurationX`  is a library of common toolsets,
//! including but not limited to functions such as time-consuming analysis
//!
//! # Examples
//!
//! A simple:
//!
//! ```no_run
//! use std::{thread, time};
//! use whosly::duration::DurationX;
//!
//! let now = DurationX::new();
//!
//! let ten_millis = time::Duration::from_millis(100);
//! thread::sleep(ten_millis);
//!
//! let duration = now.release();
//! println!("耗时：{}", duration);
//! ```
//!

use std::{thread, time};
use std::time::Instant;
use std::fs;

// pub use self::kinds::PrimaryColor;
// pub use self::kinds::SecondaryColor;
// pub use self::utils::mix;

mod doc;

pub mod duration;

#[global_allocator]
static ALLOC: snmalloc_rs::SnMalloc = snmalloc_rs::SnMalloc;

#[cfg(test)]
mod tests {
    use std::{thread, time};
    use crate::duration::DurationX;

    #[test]
    fn it_works() {
        let result = 2 + 2;
        assert_eq!(result, 4);

        let now = DurationX::new();

        let ten_millis = time::Duration::from_millis(500);
        thread::sleep(ten_millis);

        let duration = now.release();
        println!("耗时：{}", duration);
    }
}
